<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>元素显示模式转换</title>
  <style>
    a {
      width: 500px;
      height: 49px;
      background-color: pink;
      /* 把行内元素 a 转换为 块级元素 */
      display: block;
    }

    div {
      width: 300px;
      height: 99px;
      background-color: green;
      /* 把 div 块级元素 转换为 行内元素 */
      display: inline;
    }

    span {
      width: 399px;
      height: 99px;
      background-color: red;
      /* 把行内元素转换为行内块元素 */
      display: inline-block;
    }
  </style>
</head>

<body>
  <a href="#">一只猪一只猪</a>
  <a href="#">一只猪一只猪</a>
  <div>一只猪一只猪</div>
  <div>一只猪一只猪</div>
  <span>行内元素转换为行内块元素</span>
  <span>行内元素转换为行内块元素</span>
</body>

</html>